import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Form/index';
import { MODE } from '/@/components/CodeEditor';

export const quadraticColumns: BasicColumn[] = [
  {
    title: '函数名称',
    dataIndex: 'name',
  },
  {
    title: '函数内容',
    dataIndex: 'content',
  },
];

export const quadraticSchemas: FormSchema[] = [
  {
    field: 'name',
    component: 'Input',
    label: `函数名称`,
    rules: [{ required: true }],
    componentProps: {
      mode: MODE.JS,
    },
    colProps: {
      span: 12,
    },
  },
  {
    field: 'title',
    component: 'Input',
    label: `函数标题`,
    colProps: {
      span: 12,
    },
  },
  {
    field: 'content',
    component: 'ButtonCodeEditor',
    label: `函数内容`,
    rules: [{ required: true }],
    colProps: {
      span: 24,
    },
  },
  // {
  //   field: 'type',
  //   component: 'RadioGroup',
  //   label: `运行位置`,
  //   rules: [{ required: true }],
  //   colProps: {
  //     span: 12,
  //   },
  //   componentProps: {
  //     options: [
  //       {
  //         label: '前台',
  //         value: '1',
  //       },
  //       {
  //         label: '后台',
  //         value: '2',
  //       },
  //     ],
  //   },
  // },
  {
    field: 'runType',
    component: 'RadioGroup',
    label: `运行位置`,
    rules: [{ required: true }],
    colProps: {
      span: 12,
    },
    componentProps: {
      options: [
        {
          label: '前台',
          value: '1',
        },
        {
          label: '后台',
          value: '0',
        },
      ],
    },
  },
  {
    field: 'summary',
    component: 'InputTextArea',
    label: `函数说明`,
    rules: [{ required: true }],
    colProps: {
      span: 24,
    },
  },
];
